package ai.plantdata.InterceptingFilterPattern.test;

import ai.plantdata.InterceptingFilterPattern.Target;
import ai.plantdata.InterceptingFilterPattern.client.Client;
import ai.plantdata.InterceptingFilterPattern.filter.impl.AuthenticationFilter;
import ai.plantdata.InterceptingFilterPattern.filter.impl.DebugFilter;
import ai.plantdata.InterceptingFilterPattern.manager.FilterManager;

/**
 * @Author: WangHui
 * @Date: 2020/12/24 16:30
 * @Description:
 */
public class InterceptingFilterDemo {
    public static void main(String[] args) {
        FilterManager filterManager = new FilterManager(new Target());
        filterManager.setFilter(new AuthenticationFilter());
        filterManager.setFilter(new DebugFilter());

        Client client = new Client();
        client.setFilterManager(filterManager);
        client.sendRequest("HOME");
    }
}
